[u,Fs]=wavread('FSpeech.wav');
u=(u-mean(u))';
T0=1/Fs;%хмрепбюк лефдс дбслъ нряверюлх
T1=0.025;%25 ЛЯ
T2=0.06;%60 ЛЯ
N1=T1/T0;
N2=T2/T0;
N=length(u);
figure(1),plot(u/T0),grid;
%беянбюъ тсмйжхъ 1/T
u1=zeros(1,N-N1);
for k=1:(N-N1),
    u1(k)=sum(abs(u(k:(k+N1-1))));
end
u1=u1/T1;
figure(2),plot(u1),grid;
u2=zeros(1,N-N2);
for k=1:(N-N2),
    u2(k)=sum(abs(u(k:(k+N2-1))));
end
u2=u2/T2;
figure(3),plot(u2),grid;
%беянбюъ тсмйжхъ 1/T*exp(-(t1-t)/T)
u3=zeros(1,N-N1);
for k=1:N1,
    e1(k)=exp(-((N1-k)*T0)/T1);
end
for k=1:(N-N1),
    u3(k)=sum(e1.*abs(u(k:(k+N1-1))));
end
u3=u3/T1;
figure(4),plot(u3),grid;
u4=zeros(1,N-N2);
for k=1:N2,
    e2(k)=exp(-((N2-k)*T0)/T2);
end
for k=1:(N-N2),
    u4(k)=sum(e2.*abs(u(k:(k+N2-1))));
end
u4=u4/T2;
figure(5),plot(u4),grid;
%окнрмнярэ бепнърмнярх
[h,x]=hist(u/T0,50);
sigm=std(u/T0);
figure(6),semilogy(x/sigm,h/max(h)),xlim([-5 5]),ylim([0.001 1]),grid
%хмрецпюкэмше тсмйжхх пюяопедекемхъ
[h1,x1]=hist(20*log10(u1/max(u1)),1000);
ifr1=cumsum(h1);
figure(7),plot(x1,ifr1/ifr1(1000)),grid
[h2,x2]=hist(20*log10(u2/max(u2)),1000);
ifr2=cumsum(h2);
figure(8),plot(x2,ifr2/ifr2(1000)),grid
[h3,x3]=hist(20*log10(u3/max(u3)),1000);
ifr3=cumsum(h3);
figure(9),plot(x3,ifr3/ifr3(1000)),grid
[h4,x4]=hist(20*log10(u4/max(u4)),1000);
ifr4=cumsum(h4);
figure(10),plot(x4,ifr4/ifr4(1000)),grid

